#include <stdio.h>

int main() {
	char a, b, c;
	char max = '0';
	scanf("%c%c%c", &a, &b, &c);
	do
		max++;
	while (max < a || max < b || max < c);
	printf("%c", max);
}
